CFLAGS = -Wall -O2

all: program

program: main.o count.o LargeNumber.o LargeNumberPtr.o NumArray.o ProxyNum.o
	g++ ${CFLAGS} main.o count.o LargeNumber.o LargeNumberPtr.o NumArray.o ProxyNum.o -o program

main.o: main.cpp count.h LargeNumber.h LargeNumberPtr.h
	g++ -c ${CFLAGS} main.cpp count.h LargeNumber.h LargeNumberPtr.h

count.o: count.cpp LargeNumber.h
	g++ -c ${CFLAGS} count.cpp LargeNumber.h

LargeNumber.o: LargeNumber.cpp LargeNumber.h
	g++ -c ${CFLAGS} LargeNumber.cpp LargeNumber.h

LargeNumberPtr.o: LargeNumberPtr.cpp LargeNumberPtr.h
	g++ -c ${CFLAGS} LargeNumberPtr.cpp LargeNumberPtr.h

NumArray.o: NumArray.cpp NumArray.h ProxyNum.h
	g++ -c ${CFLAGS} NumArray.cpp NumArray.h

ProxyNum.o: ProxyNum.cpp ProxyNum.h NumArray.h
	g++ -c ${CFLAGs} ProxyNum.cpp ProxyNum.h NumArray.h

run: program
	./program

clean:
	rm *.o
	rm *.h.gch
	rm program
